package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter @Getter
public class CommunityQueryObject extends QueryObject {

    private String orderBy="c.viewnum desc";

    //热门是0，最新是1
    private Integer state = 0;

    public String getOrderBy() {

        if (state == 0){
            orderBy="c.viewnum desc";
        }else if (state == 1){
            orderBy="c.creatTime desc";
        }else {
            orderBy="c.creatTime desc";
        }
        return orderBy;
    }

}
